export interface CommentEntity {
  taskId?: number | string
  content?: number | string
  replyId?: number | string
}
export const apiComment = {
  /**
   * 评论列表
   * @returns
   */
  list(params?: any): Promise<any> {
    return api.page(
      {
        url: 'demand/taskComment/page',
        params: params, // 将参数传递给 API 调用
      },
      { pageSize: params.pageSize, pageNum: params.pageNum },
    )
  },
  /**
   * 评论新增
   * @param data
   * @returns
   */
  add: (data: CommentEntity): Promise<any> => {
    return api.add({
      url: 'demand/taskComment/insert',
      data,
    })
  },
  /**
   * 评论删除
   * @param ids
   * @returns
   */
  delete: (params: any): Promise<any> => {
    return api.delete({
      url: 'demand/taskComment/delete',
      params
    })
  },
  /**
   * 点赞/取消赞
   * @param params
   * @returns
   */
  likeComment: (id: number | string): Promise<any> => {
    return api.request({
      url: `demand/taskComment/likeTask/${id}`,
    })
  },
}
